package com.lej.home.http

import com.google.gson.JsonObject
import com.lej.dataservice.club.bean.main.home.*
import com.lej.dataservice.club.bean.main.my.MyUserInfoAll
import com.lej.dataservice.club.http.BaseListRes
import com.lej.dataservice.club.http.BaseResponse
import com.lej.dataservice.club.http.RetrofitClient
import okhttp3.RequestBody
import org.json.JSONObject
import retrofit2.http.*

val homeApiService: HomeApiService = RetrofitClient.getInstance().create(HomeApiService::class.java)

interface HomeApiService {
    /**首页banner接口*/
    @Headers("Content-Type: application/json")
    @POST("/trove/nfthouse/appBannerHouseList")
    suspend fun bannerHouseList(): BaseListRes<BannerInfo>

    /**宝藏屋列表*/
    @GET("/trove/nfthouse/appfind")
    suspend fun NFTRoomList(): BaseListRes<RoomNftInfo>

    /**获取用户信息*/
    @Headers("Content-Type: application/json")
    @GET("/trove/nfthouse/userinfo")
    suspend fun getUserInfo(): BaseResponse<MyUserInfoAll>


    /**nft详情*/
    @Headers("Content-Type: application/json")
    @POST("/trove/nft/appInfo")
    suspend fun getNftDetailInfo(@Body requestBody: RequestBody): BaseResponse<NftDetailInfo>

    /**
     * 评论列表
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/comment/commentListApp")
    suspend fun getCommentInfo(@Body requestBody: RequestBody): BaseResponse<NftCommentInfo>

    /**
     * 评论
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/nftComment/doComment")
    suspend fun sendComment(@Body requestBody: RequestBody): BaseResponse<JsonObject>

    /**
     * 获取数字藏品证书
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/digitalcollection/certificate")
    suspend fun certificate(@Body requestBody: RequestBody): BaseResponse<NftPackageInfo>


    /**获取用户未读消息*/
    @Headers("Content-Type: application/json")
    @GET("/trove/homepage/appData")
    suspend fun getHomeData(): BaseResponse<List<HomeShowInfo>>

    /**获取用户未读消息*/
    @Headers("Content-Type: application/json")
    @GET("/trove/nFTTransfer/unreadNum")
    suspend fun getUnreadMsg(): BaseResponse<JsonObject>

    /**御守nft权益（兑换）列表*/
    @Headers("Content-Type: application/json")
    @GET("/trove/yushou/rights/list")
    suspend fun getRightInfo(@Query("nft_id") id:Int): BaseResponse<NftRightInfo>

    /**获取用户邀请状态*/
    @Headers("Content-Type: application/json")
    @GET("/trove/nftBackpack/usersAttr")
    suspend fun usersAttr(): BaseResponse<JsonObject>

    /**
     * 藏品转让*/
    @Headers("Content-Type: application/json")
    @POST("/trove/transfer/backpack")
    suspend fun collectTransfer(@Body body: RequestBody): BaseResponse<JsonObject>

    /**
     * 实名认证
     */
//    @Headers("Content-Type: application/json")
//    @POST("/trove/real_id")
//    suspend fun realNameAuth(@Body body: RequestBody): BaseResponse<JsonObject>

    /**
     * 购买/求购下单详情页
     */
    @Headers("Content-Type: application/json")
    @GET("/trove/transfer/apply_page")
    suspend fun getPayDetail(@Query("nft_id") id: Int): BaseResponse<PayDetailInfo>

    /**
     * 求购下单
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/transfer/order")
    suspend fun createOrder(@Body body: RequestBody): BaseResponse<JsonObject>

    /**
     * 购买下单
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/origin/order")
    suspend fun createBuyOrder(@Body body: RequestBody): BaseResponse<JsonObject>

    /**
     * 求购订单支付
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/transfer/pay")
    suspend fun orderPay(@Body body: RequestBody): BaseResponse<WxPayInfo>

    /**
     * 购买订单支付
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/origin/pay")
    suspend fun buyPay(@Body body: RequestBody): BaseResponse<WxPayInfo>

    /**
     * 购买订单详情
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/order/info")
    suspend fun buyPayDetail(@Query("id") id: Int): BaseResponse<BuyDetailInfo>

    /**
     * 获取个人空间信息
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/space/getSpace")
    suspend fun getPersonSpaceInfo(): BaseResponse<PersonSpaceInfo>

    /**
     * 求购订单详情
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/transfer/apply_detail")
    suspend fun orderPayDetail(@Query("id") id: Int): BaseResponse<OrderDetailInfo>

    /**
     * 七夕公告,音乐会PC端下载地址
     */
    @Headers("Content-Type: application/json")
    @GET("/trove/client/config_data")
    suspend fun activeNotice( @Query("tags[]") list: List<String>,
                              @Query("version") version: String): BaseResponse<JsonObject>
}